<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<html>
<head>
<title>我的待办任务</title>
<script type="text/javascript">
	var $grid, $nodeGrid;
	var selectTableRow;//选中的行数据
	$(function() {
		$grid = $("#grid")
				.datagrid(
						$
								.extend(
										datagridOption,
										{
											url : "${ctx}/bpm/workspace/workspace-listPersonalTasks",
											columns : [ [
													{
														field : 'ck',
														checkbox : true
													}/* ,
													{
														field : 'id',
														title : '编号',
														sortable : true
													} */ ,
													{
														field : 'promoter',
														title : '发起人',
														sortable : true
													}, 
													{
														field : 'pdname',
														title : '流程名称',
														sortable : true
													},
													{
														field : 'name',
														title : '任务名称',
														sortable : true
													},
													{
														field : 'createTime',
														title : '创建时间',
														sortable : true
													}/* ,
													{
														field : 'assigneeName',
														title : '负责人',
														sortable : true
													} */,
													{
														field : 'lastTaskMan',
														title : '上一节点提交人',
														sortable : true
													},
													{
														field : 'processInstanceId',
														title : '操作',
														formatter : function(val, row) {
															var result = "<a class='l-btn l-btn-plain' href='#'  onclick='window.parent.addTab(\"handleTask\",\"["
																	+ row.name
																	+ "]任务办理\",\""
																	+ kl.ctx
																	+ "/bpm/confForm/form-viewHandleTaskPage?taskId="
																	+ row.id
																	+ "\")'><span class='l-btn-left'><span class='l-btn-text icon-hamburg-document l-btn-icon-left'>办理</span></span></a>";
															result += "<a class='l-btn l-btn-plain' href='#'  onclick='viewHistory(\""
																	+ row.pid
																	+ "\")'><span class='l-btn-left'><span class='l-btn-text icon-hamburg-graphic l-btn-icon-left'>历史</span></span></a>";
															return result;
														}
													} ] ]
										}));
		$("#search").click(function() {
			$grid.datagrid('load', getSearchConditions("#tt"));
		});
	});
	function viewHistory(processInstanceId) {
		window.parent.addTab("processHistory","流程历史", "${ctx}/bpm/confForm/task-viewHistory?processInstanceId="
				+ processInstanceId);
	}
</script>
</head>
<body>
	<div data-options="region:'center',fit:true,border:false">
		<table id="grid">
		</table>
		<div id="tt" class="row">
			<div class="col-md-12">
				<form class="form-grid-search form-inline">
					<div class="form-group">
						<input type="text" class="form-control"
							name="search_LIKE_processDefinitionId" placeholder="流程定义ID" />
					</div>
					<button type="button" id="search" class="btn btn-primary">
						<span class="glyphicon glyphicon-search"></span> 查询
					</button>
				</form>
			</div>
		</div>
	</div>
</body>
</html>
